package love.xiaohh.datasource.entities.order;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * 订单
 * </p>
 *
 * @author tanghai
 * @version 1.0
 * @date 2021-12-03 星期五 14:09:19
 * @file Order.java
 */
public class Order implements Serializable {

    /**
     * 订单id
     */
    private Long orderId;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 订单费用
     */
    private BigDecimal cost;

    public Long getOrderId() {
        return orderId;
    }

    public Order setOrderId(Long orderId) {
        this.orderId = orderId;
        return this;
    }

    public Long getUserId() {
        return userId;
    }

    public Order setUserId(Long userId) {
        this.userId = userId;
        return this;
    }

    public BigDecimal getCost() {
        return cost;
    }

    public Order setCost(BigDecimal cost) {
        this.cost = cost;
        return this;
    }

    /**
     * 重写转换为字符串的方法，方便调试
     *
     * @return 转换后的字符串
     */
    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
